<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Vertical Text</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Pango Reference Manual">
<link rel="up" href="pango.html" title="Basic Pango Interfaces">
<link rel="prev" href="pango-Bidirectional-Text.html" title="Bidirectional Text">
<link rel="next" href="rendering.html" title="Rendering with Pango">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="pango-Bidirectional-Text.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="pango.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Pango Reference Manual</th>
<td><a accesskey="n" href="rendering.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#pango-Vertical-Text.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#pango-Vertical-Text.description" class="shortcut">Description</a>
                   | 
                  <a href="#pango-Vertical-Text.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="pango-Vertical-Text"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="pango-Vertical-Text.top_of_page"></a>Vertical Text</span></h2>
<p>Vertical Text — Laying text out in vertical directions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="pango-Vertical-Text.synopsis"></a><h2>Synopsis</h2>
<a name="PangoGravity"></a><a name="PangoGravityHint"></a><pre class="synopsis">enum                <a class="link" href="pango-Vertical-Text.html#PangoGravity-enum" title="enum PangoGravity">PangoGravity</a>;
enum                <a class="link" href="pango-Vertical-Text.html#PangoGravityHint-enum" title="enum PangoGravityHint">PangoGravityHint</a>;
#define             <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-IS-VERTICAL:CAPS" title="PANGO_GRAVITY_IS_VERTICAL()">PANGO_GRAVITY_IS_VERTICAL</a>           (gravity)
<a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-matrix" title="pango_gravity_get_for_matrix ()">pango_gravity_get_for_matrix</a>        (<em class="parameter"><code>const <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a> *matrix</code></em>);
<a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script" title="pango_gravity_get_for_script ()">pango_gravity_get_for_script</a>        (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);
<a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script-and-width" title="pango_gravity_get_for_script_and_width ()">pango_gravity_get_for_script_and_width</a>
                                                        (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> wide</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);
<span class="returnvalue">double</span>              <a class="link" href="pango-Vertical-Text.html#pango-gravity-to-rotation" title="pango_gravity_to_rotation ()">pango_gravity_to_rotation</a>           (<em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> gravity</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GEnum
   +----PangoGravity
</pre>
<pre class="synopsis">
  GEnum
   +----PangoGravityHint
</pre>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.description"></a><h2>Description</h2>
<p>
Since 1.16, Pango is able to correctly lay vertical text out.  In fact, it can
set layouts of mixed vertical and non-vertical text.  This section describes
the types used for setting vertical text parameters.
</p>
<p>
The way this is implemented is through the concept of
<em class="firstterm">gravity</em>.  Gravity of normal Latin text is south.  A
gravity value of east means that glyphs will be rotated ninety degrees
counterclockwise.  So, to render vertical text one needs to set the gravity
and rotate the layout using the matrix machinery already in place.  This has
the huge advantage that most algorithms working on a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> do not need
any change as the assumption that lines run in the X direction and stack in
the Y direction holds even for vertical text layouts.
</p>
<p>
Applications should only need to set base gravity on <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> in use, and
let Pango decide the gravity assigned to each run of text.  This automatically
handles text with mixed scripts.  A very common use is to set the context base
gravity to auto using <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>
and rotate the layout normally.  Pango will make sure that
Asian languages take the right form, while other scripts are rotated normally.
</p>
<p>
The correct way to set gravity on a layout is to set it on the context
associated with it using <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>.  The context
of a layout can be accessed using <a class="link" href="pango-Layout-Objects.html#pango-layout-get-context" title="pango_layout_get_context ()"><code class="function">pango_layout_get_context()</code></a>.  The currently
set base gravity of the context can be accessed using
<a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a> and the <em class="firstterm">resolved</em>
gravity of it using <a class="link" href="pango-Text-Processing.html#pango-context-get-gravity" title="pango_context_get_gravity ()"><code class="function">pango_context_get_gravity()</code></a>.  The resolved gravity is
the same as the base gravity for the most part, except that if the base
gravity is set to <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, the resolved gravity will depend
on the current matrix set on context, and is derived using
<a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-matrix" title="pango_gravity_get_for_matrix ()"><code class="function">pango_gravity_get_for_matrix()</code></a>.
</p>
<p>
The next thing an application may want to set on the context is the
<em class="firstterm">gravity hint</em>.  A <a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> instructs how
different scripts should react to the set base gravity.
</p>
<p>
Font descriptions have a gravity property too, that can be set using
<a class="link" href="pango-Fonts.html#pango-font-description-set-gravity" title="pango_font_description_set_gravity ()"><code class="function">pango_font_description_set_gravity()</code></a> and accessed using
<a class="link" href="pango-Fonts.html#pango-font-description-get-gravity" title="pango_font_description_get_gravity ()"><code class="function">pango_font_description_get_gravity()</code></a>.  However, those are rarely useful
from application code and are mainly used by <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> internally.
</p>
<p>
Last but not least, one can create <a class="link" href="pango-Text-Attributes.html#PangoAttribute" title="struct PangoAttribute"><span class="type">PangoAttribute</span></a>s for gravity
and gravity hint using <a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-new" title="pango_attr_gravity_new ()"><code class="function">pango_attr_gravity_new()</code></a> and
<a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-hint-new" title="pango_attr_gravity_hint_new ()"><code class="function">pango_attr_gravity_hint_new()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="PangoGravity-enum"></a><h3>enum PangoGravity</h3>
<pre class="programlisting">typedef enum {
  PANGO_GRAVITY_SOUTH,
  PANGO_GRAVITY_EAST,
  PANGO_GRAVITY_NORTH,
  PANGO_GRAVITY_WEST,
  PANGO_GRAVITY_AUTO
} PangoGravity;
</pre>
<p>
The <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> type represents the orientation of glyphs in a segment
of text.  This is useful when rendering vertical text layouts.  In
those situations, the layout is rotated using a non-identity PangoMatrix,
and then glyph orientation is controlled using <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.
Not every value in this enumeration makes sense for every usage of
<a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>; for example, <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> only can be passed to
<a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a> and can only be returned by
<a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a>.
</p>
<p>
See also: <a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="PANGO-GRAVITY-SOUTH:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_SOUTH</code></span></p></td>
<td>Glyphs stand upright (default)
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-EAST:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_EAST</code></span></p></td>
<td>Glyphs are rotated 90 degrees clockwise
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-NORTH:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_NORTH</code></span></p></td>
<td>Glyphs are upside-down
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-WEST:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_WEST</code></span></p></td>
<td>Glyphs are rotated 90 degrees counter-clockwise
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-AUTO:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_AUTO</code></span></p></td>
<td>Gravity is resolved from the context matrix
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="PangoGravityHint-enum"></a><h3>enum PangoGravityHint</h3>
<pre class="programlisting">typedef enum {
  PANGO_GRAVITY_HINT_NATURAL,
  PANGO_GRAVITY_HINT_STRONG,
  PANGO_GRAVITY_HINT_LINE
} PangoGravityHint;
</pre>
<p>
The <a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> defines how horizontal scripts should behave in a
vertical context.  That is, English excerpt in a vertical paragraph for
example.
</p>
<p>
See <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="PANGO-GRAVITY-HINT-NATURAL:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_NATURAL</code></span></p></td>
<td>scripts will take their natural gravity based
on the base gravity and the script.  This is the default.
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-HINT-STRONG:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></span></p></td>
<td>always use the base gravity set, regardless of
the script.
</td>
</tr>
<tr>
<td><p><a name="PANGO-GRAVITY-HINT-LINE:CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_LINE</code></span></p></td>
<td>for scripts not in their natural direction (eg.
Latin in East gravity), choose per-script gravity such that every script
respects the line progression.  This means, Latin and Arabic will take
opposite gravities and both flow top-to-bottom for example.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-GRAVITY-IS-VERTICAL:CAPS"></a><h3>PANGO_GRAVITY_IS_VERTICAL()</h3>
<pre class="programlisting">#define             PANGO_GRAVITY_IS_VERTICAL(gravity)</pre>
<p>
Whether a <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> represents vertical writing directions.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gravity</code></em> :</span></p></td>
<td>the <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> to check</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>gravity</code></em> is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-EAST:CAPS"><code class="literal">PANGO_GRAVITY_EAST</code></a> or <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-WEST:CAPS"><code class="literal">PANGO_GRAVITY_WEST</code></a>,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-matrix"></a><h3>pango_gravity_get_for_matrix ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        pango_gravity_get_for_matrix        (<em class="parameter"><code>const <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a> *matrix</code></em>);</pre>
<p>
Finds the gravity that best matches the rotation component
in a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td>a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the gravity of <em class="parameter"><code>matrix</code></em>, which will never be
<a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, or <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-SOUTH:CAPS"><code class="literal">PANGO_GRAVITY_SOUTH</code></a> if <em class="parameter"><code>matrix</code></em> is <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-script"></a><h3>pango_gravity_get_for_script ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        pango_gravity_get_for_script        (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);</pre>
<p>
Based on the script, base gravity, and hint, returns actual gravity
to use in laying out a single <a class="link" href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a>.
</p>
<p>
If <em class="parameter"><code>base_gravity</code></em> is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, it is first replaced with the
preferred gravity of <em class="parameter"><code>script</code></em>.  To get the preferred gravity of a script,
pass <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> and <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-HINT-STRONG:CAPS"><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></a> in.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>script</code></em> :</span></p></td>
<td>
<a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_gravity</code></em> :</span></p></td>
<td>base gravity of the paragraph</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hint</code></em> :</span></p></td>
<td>orientation hint</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>resolved gravity suitable to use for a run of text
with <em class="parameter"><code>script</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-script-and-width"></a><h3>pango_gravity_get_for_script_and_width ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="returnvalue">PangoGravity</span></a>        pango_gravity_get_for_script_and_width
                                                        (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> wide</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                                                         <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);</pre>
<p>
Based on the script, East Asian width, base gravity, and hint,
returns actual gravity to use in laying out a single character
or <a class="link" href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a>.
</p>
<p>
This function is similar to <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script" title="pango_gravity_get_for_script ()"><code class="function">pango_gravity_get_for_script()</code></a> except
that this function makes a distinction between narrow/half-width and
wide/full-width characters also.  Wide/full-width characters always
stand <span style="color: red">&lt;emph&gt;upright&lt;/emph&gt;</span>, that is, they always take the base gravity,
whereas narrow/full-width characters are always rotated in vertical
context.
</p>
<p>
If <em class="parameter"><code>base_gravity</code></em> is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, it is first replaced with the
preferred gravity of <em class="parameter"><code>script</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>script</code></em> :</span></p></td>
<td>
<a class="link" href="pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a> to query</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>wide</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for wide characters as returned by <a href="http://library.gnome.org/devel/glib/unstable/glib-Unicode-Manipulation.html#g-unichar-iswide"><code class="function">g_unichar_iswide()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>base_gravity</code></em> :</span></p></td>
<td>base gravity of the paragraph</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hint</code></em> :</span></p></td>
<td>orientation hint</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>resolved gravity suitable to use for a run of text
with <em class="parameter"><code>script</code></em> and <em class="parameter"><code>wide</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.26</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-to-rotation"></a><h3>pango_gravity_to_rotation ()</h3>
<pre class="programlisting"><span class="returnvalue">double</span>              pango_gravity_to_rotation           (<em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> gravity</code></em>);</pre>
<p>
Converts a <a class="link" href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> value to its natural rotation in radians.
<em class="parameter"><code>gravity</code></em> should not be <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>.
</p>
<p>
Note that <a class="link" href="pango-Glyph-Storage.html#pango-matrix-rotate" title="pango_matrix_rotate ()"><code class="function">pango_matrix_rotate()</code></a> takes angle in degrees, not radians.
So, to call <a class="link" href="pango-Glyph-Storage.html#pango-matrix-rotate" title="pango_matrix_rotate ()"><code class="function">pango_matrix_rotate()</code></a> with the output of this function
you should multiply it by (180. / G_PI).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gravity</code></em> :</span></p></td>
<td>gravity to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the rotation value corresponding to <em class="parameter"><code>gravity</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a>,
<a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>,
<a class="link" href="pango-Text-Processing.html#pango-context-get-gravity" title="pango_context_get_gravity ()"><code class="function">pango_context_get_gravity()</code></a>,
<a class="link" href="pango-Text-Processing.html#pango-context-get-gravity-hint" title="pango_context_get_gravity_hint ()"><code class="function">pango_context_get_gravity_hint()</code></a>,
<a class="link" href="pango-Text-Processing.html#pango-context-set-gravity-hint" title="pango_context_set_gravity_hint ()"><code class="function">pango_context_set_gravity_hint()</code></a>,
<a class="link" href="pango-Fonts.html#pango-font-description-set-gravity" title="pango_font_description_set_gravity ()"><code class="function">pango_font_description_set_gravity()</code></a>,
<a class="link" href="pango-Fonts.html#pango-font-description-get-gravity" title="pango_font_description_get_gravity ()"><code class="function">pango_font_description_get_gravity()</code></a>,
<a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-new" title="pango_attr_gravity_new ()"><code class="function">pango_attr_gravity_new()</code></a>,
<a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-hint-new" title="pango_attr_gravity_hint_new ()"><code class="function">pango_attr_gravity_hint_new()</code></a>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>